
/**封装请求table接口*/
export const getTableData = (serviceName, params) => {
  if (!serviceName) return;
  return new Promise((resolve, reject) => {
    serviceName(params).then(res => {
      resolve(res)
    }).catch(() => {
      reject(false)
    })
  })
}

/**getMessage**/
export const getMessage = (self, error, type = 'warning') => {
  self.$message({
    type: type,
    message: error,
  });
  return false;
}

// 判断是否为手机号
export const isPhone = (phone) => {
  var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;
  if (phoneReg.test(phone)) {
    return true;
  } else {
    return false;
  }
}
